// app.ts
import './utils/extendApi'
import { env } from './utils/env'
App({
  globalData: {
    baseUrl: env.baseUrl,
    whiteUrl: [
      '/admin/client/login',
      '/custom/getOpenId/',
      '/client/goods/page',
      '/system/common/file/',
      '/client/ad/getList/',
      '/market/client/ad/getList/',
      '/client/goods/type/list'
    ]
  },

  onLaunch() {
    const updateManger = wx.getUpdateManager()
    updateManger.onUpdateReady(function () {
      wx.showModal({
        title: '更新提示',
        content: "先版本已经准备好，是否重启应用？",
        success(res) {
          if (res.confirm) {
            updateManger.applyUpdate()
          }
        }
      })
    })
  },
  onShow() {
    // let token = getToken();
    // if (token == '' || token == null || !token || token == undefined) {
    //   wx.navigateTo({
    //     url: '/pages/login/login'
    //   })
    // }
  }
})